Player = class('Player', Entity):include(Stateful)

function Player:initialize()
	--self.img = love.graphics.newImage('img/thin_man-frames.png')
	Entity.initialize(self)
	self.img = love.graphics.newImage('img/runner-frames2.png')	
	self.punch_img = love.graphics.newImage('img/runner-punch-frames2.png')
	self.x = 0
	self.y = 0
	self.height = 128
	self.width = 32
	self.br_x = self.x + self.width
	self.br_y = self.y + self.height
	self.name = "slave"
	self.entity_type = "player"
	self.anim = newAnimation(self.img)
	self.anim:addFrame(0, 0, 32, 128, 0.1)
	self.anim:addFrame(33, 0, 39, 128, 0.1)
	self.anim:addFrame(72, 0, 74, 128, 0.2)
	self.anim:addFrame(145, 0, 32, 128, 0.1)
	self.anim:addFrame(177, 0, 33, 64, 0.1)
	self.anim.skip = { 5 }
	self.punch_anim = newAnimation(self.punch_img)
	self.punch_anim:addFrame(0, 0, 49, 128, 0.1)
	self.punch_anim:addFrame(50, 0, 62, 128, 0.2)
	self.punch_anim:addFrame(112, 0, 32, 128, 0.1)
	--[[
	self.anim:addFrame(0, 0, 32, 128, 0.1)
	self.anim:addFrame(33, 0, 41, 128, 0.1)
	self.anim:addFrame(75, 0, 32, 128, 0.1)
	self.anim:addFrame(107, 0, 38, 128, 0.1)
	]]
	self.anim:setMode("loop")
	self.anim:setSpeed(2)
	self.punch_anim:setMode("once")
	self.punch_anim:setSpeed(0.5)
	self:gotoState("platform")

end

function Player:spawn(x, y)
	self.x = x
	self.y = y
end

require'src.player_states.platform'
